const fs = require('fs');
const path = require('path');

// 读取package.json
const packagePath = path.join(__dirname, '../package.json');
const packageJson = require(packagePath);

// 添加chromium-args配置
packageJson['chromium-args'] = '--disable-web-security --allow-file-access-from-files';

// 更新node-remote配置
packageJson['node-remote'] = [
  '*://localhost/*',
  'http://127.0.0.1:*/*'
];

// 保存修改后的package.json
fs.writeFileSync(packagePath, JSON.stringify(packageJson, null, 2));

console.log('package.json 已更新，添加了网络访问配置'); 